<?php
	include "./addons/AntiRed/config/config.php";
	include "./addons/AntiRed/expand/common.html";
?>


<div id="lywq_AntiRed_image" class="lywq_cox" style="display:none">
	<div class="lywq_AntiRed_tc">
		<?php
			echo '<img src="' .$lywq['AntiRed']['fpb']['image']. '" width="100%" />';
		?>
		<div class="AntiRed-tip">
		    <span class="guidance-desc">点击右上角或复制网址自行打开</span>
		</div>
		<a onclick="copy_url()" class="AntiRed-btn">点此复制本站网址</a>
		<a onclick="jumpurl()" class="AntiRed-btn">立即跳转</a>
	</div>
</div>
<style>
.lywq_cox {position: fixed;width: 100%;height: 100%;background: rgba(0, 0, 0, 0.2);display: none;top: 0;right: 0;bottom: 0;left: 0;overflow: hidden;outline: 0;-webkit-overflow-scrolling: touch;background-color: rgb(0, 0, 0);filter: alpha(opacity=60);background-color: rgba(0, 0, 0, 0.6);z-index: 9999;}
.lywq_AntiRed_tc{width: 360px;height: 500px;border: 5px solid #FFA500;border-radius: 10px;position:fixed;top:-30px;right:0;left:0;bottom:0;margin:auto;background: #fff;}
.AntiRed-tip{margin:0 auto;width:290px;text-align:center;font-size:15px;color:#2466f4;background:url() left center/auto 15px repeat-x}
.AntiRed-tip .guidance-desc{background-color:#fff;padding:0 5px}
.AntiRed-btn{display:block;width:214px;height:40px;line-height:40px;margin:18px auto 0 auto;text-align:center;font-size:18px;color:#2466f4;border-radius:20px;border:.5px #2466f4 solid;text-decoration:none}
</style>
<!--微信防屏蔽代码begin-->
<script type="text/javascript">
if (browser.versions.mobile) {
        if(browser.versions.android && !browser.versions.bsl){
            if('<?php echo $lywq['AntiRed']['terminal'];?>'.indexOf('android')!==-1){
            	fpbController();
            }
    	}
        if (browser.versions.ios) {
            if('<?php echo $lywq['AntiRed']['terminal'];?>'.indexOf('ios')!==-1){
            	fpbController();
            }
        }
        if (browser.versions.weixin) {
            if('<?php echo $lywq['AntiRed']['terminal'];?>'.indexOf('weixin')!==-1){
            	fpbController();
            }
        }
        if (browser.versions.qq) {
            if('<?php echo $lywq['AntiRed']['terminal'];?>'.indexOf('qq')!==-1){
            	fpbController();
            }
        }
        if (browser.versions.bsl) {
            if('<?php echo $lywq['AntiRed']['terminal'];?>'.indexOf('bsl')!==-1){
            	fpbController();
            }
        }
}else{
    if('<?php echo $lywq['AntiRed']['terminal'];?>'.indexOf('pc')!==-1){
    	fpbController();
    }
}

var url = this.location.href;
function copy_url(){
    copyText(true,url);
    alert("复制成功，请使用浏览器打开！");
}
function openu(u){
	window.location.href = u;
}
function jumpurl(){
	openu("ucbrowser://"+url);
	openu("mttbrowser://url="+url);
	openu("baiduboxapp://browse?url="+url);
	openu("googlechrome://browse?url="+url);
	openu("mibrowser:"+url);
	openu("taobao://"+url.split("://")[1]);
	openu("alipays://platformapi/startapp?appId=20000067&url="+url);
}

function fpbController(){
	if(<?php echo $lywq['AntiRed']['status'];?> == 1){
		if(<?php echo $lywq['AntiRed']['fpb']['type'];?> == 1){
			var div=document.getElementById("lywq_AntiRed_image");
			div.style.display="block"
		}
		else if(<?php echo $lywq['AntiRed']['fpb']['type'];?> == 2){
			location.href='<?php echo $lywq['AntiRed']['fpb']['link'];?>';
		}
		else if(<?php echo $lywq['AntiRed']['fpb']['type'];?> == 3){
			alert("<?php echo $lywq['AntiRed']['fpb']['text'];?>");
		}
		else if(<?php echo $lywq['AntiRed']['fpb']['type'];?> == 4){
			var domainName = window.location.host;
			var pathname = window.location.pathname;
			var search = window.location.search;
			var newUrl = 'http://<?php echo $lywq['AntiRed']['fpb']['domain'];?>'+pathname+search;
			if(domainName!='<?php echo $lywq['AntiRed']['fpb']['domain'];?>'){
				window.open(newUrl,"_self");
			}
		}
	}
}
</script>
<!--微信防屏蔽代码end-->

<!--全局复制代码begin-->
<script src="https://www.muyin.life/MaccmsV10plugins/clipboard.js"></script>
<script>
if(<?php echo $lywq['autoCopy']['status'];?> == 1){
	var clipboard = new Clipboard('.btn', {
		text: function() {
			return '<?php echo $lywq['autoCopy']['text'];?>';
		}
	});
	clipboard.on('success', function() {
		if(checkCookie('jumpapp')==false){
			setCookie('jumpapp',true,'<?php echo $lywq['autoCopy']['jump']['time'];?>');
		}
	});
	if(getCookie('jumpapp')=='true'){
		setCookie('jumpapp',false,'<?php echo $lywq['autoCopy']['jump']['time'];?>');
		if(<?php echo $lywq['autoCopy']['jump']['type'];?> == 1){
			window.location.href = 'weixin://';
		}
		if(<?php echo $lywq['autoCopy']['jump']['type'];?> == 2){
			window.location.href = 'mqqwpa://';
		}
		if(<?php echo $lywq['autoCopy']['jump']['type'];?> == 3){
			window.location.href = 'alipays://';
		}
		if(<?php echo $lywq['autoCopy']['jump']['type'];?> == 4){
			window.location.href = 'taobao://main.m.taobao.com';
		}
		if(<?php echo $lywq['autoCopy']['jump']['type'];?> == 5){
			window.location.href = 'snssdk1128://';
		}
		if(<?php echo $lywq['autoCopy']['jump']['type'];?> == 6){
			window.location.href = 'kwai://profile/uid';
		}
	}

}
</script>
<!--全局复制代码end-->